import http from '@/utils/http/axios'
import {
  GetMenuListByUserIdResult,
} from '../model/menuModel'

enum Api {
  adminMenus = '/menu/customization/tree',
  adminPermission = '/menu/list/resource',
  adminResource = '/menu/list/user/resource'
}

/**
 * @description: 根据用户id获取用户菜单
 */
export function adminMenus() {
  return http.request<GetMenuListByUserIdResult>({
    url: Api.adminMenus,
    method: 'post'
  })
}
/**
 * @description: 获取子账号权限信息
 */
export function adminPermission() {
  return http.request({
    url: Api.adminPermission,
    method: 'post'
  })
}

/**
 * @description: 获取用户已拥有的资源
 */
export function adminResource(params) {
  return http.request({
    url: Api.adminResource,
    method: 'post',
    params
  })
}

/**
 * 根据用户Id获取权限编码
 * @param params
 */
// export function getBtnCodeListByUserId(params: GetByUserIdParams) {
//   return http.request<GetAuthCodeByUserIdResult>({
//     url: Api.GetBtnCodeListByUserId,
//     method: 'GET',
//     params
//   })
// }
